"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.天谕 = void 0;
const Big_1 = require("../core/Big");
const Point_1 = require("../core/Point");
const GameUtils_1 = __importDefault(require("../GameUtils"));
class 天谕 extends Big_1.Big {
    constructor() {
        super(...arguments);
        this.is_smelling = false; //明魂搜根
        this.smell_to_player = null; //你在搜谁
        this.is_looking = false; //天眼传真
    }
    smell(player) {
        this.is_smelling = true;
        this.smell_to_player = player;
        this.stateUpdate();
    }
    look() {
        this.is_looking = true;
        this.stateUpdate();
    }
    turnOver() {
        super.turnOver();
        this.is_smelling = false;
        this.smell_to_player = null;
        this.is_looking = false;
        this.stateUpdate();
    }
    /**
     * 技能状态变化
     */
    stateUpdate() {
        this.gameMgr.sendBroadcast(GameUtils_1.default.getObj("天谕_update", {
            "point_id": this.point.id,
            "is_smelling": this.is_smelling,
            "username": this.smell_to_player ? this.smell_to_player.username : null,
            "is_looking": this.is_looking
        }, true, false), false);
    }
    terrainAdapt() {
        switch (this.point.terrain) {
            case Point_1.Terrain.SHAN:
            case Point_1.Terrain.SHUI:
                this.die(this.player);
        }
    }
}
exports.天谕 = 天谕;
